package com.example.q_kang.hhh.view;

import android.content.Context;
import android.util.AttributeSet;

import com.ashokvarma.bottomnavigation.BottomNavigationBar;
import com.ashokvarma.bottomnavigation.BottomNavigationItem;
import com.example.q_kang.hhh.R;
import com.sskj.base.base.App;

public class NavigationBar extends BottomNavigationBar {

    public NavigationBar(Context context) {
        super(context);
        initTab();
    }

    public NavigationBar(Context context, AttributeSet attrs) {
        super(context, attrs);
        initTab();
    }

    public NavigationBar(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initTab();
    }

    private void initTab() {
        addItem(new BottomNavigationItem(R.mipmap.ic_launcher, App.INSTANCE.getString(R.string.appJavaNavigationBar1)).setInactiveIconResource(R.mipmap.icon_b_pre));
        addItem(new BottomNavigationItem(R.mipmap.icon_a_nor, App.INSTANCE.getString(R.string.appJavaNavigationBar2)).setInactiveIconResource(R.mipmap.icon_b_pre));
        addItem(new BottomNavigationItem(R.mipmap.icon_b_nor, App.INSTANCE.getString(R.string.appJavaNavigationBar3)).setInactiveIconResource(R.mipmap.icon_b_pre));
        addItem(new BottomNavigationItem(R.mipmap.icon_b_pre, App.INSTANCE.getString(R.string.appJavaNavigationBar4)).setInactiveIconResource(R.mipmap.icon_b_pre));
        setFirstSelectedPosition(0);
        initialise();
    }
}
